(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

m(x, y) → if(gt(x, y), x, y)
if(true, x, y) → s(m(p(x), y))
if(false, x, y) → 0
gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
p(0) → 0
p(s(x)) → x

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted CpxTRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

M(z0, z1) → c(IF(gt(z0, z1), z0, z1), GT(z0, z1))
IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
S tuples:

M(z0, z1) → c(IF(gt(z0, z1), z0, z1), GT(z0, z1))
IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
K tuples:none
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

M, IF, GT

Compound Symbols:

c, c1, c5

(3) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace M(z0, z1) → c(IF(gt(z0, z1), z0, z1), GT(z0, z1)) by

M(0, z0) → c(IF(false, 0, z0), GT(0, z0))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
M(x0, x1) → c

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(0, z0) → c(IF(false, 0, z0), GT(0, z0))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
M(x0, x1) → c
S tuples:

IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(0, z0) → c(IF(false, 0, z0), GT(0, z0))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
M(x0, x1) → c
K tuples:none
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

IF, GT, M

Compound Symbols:

c1, c5, c, c

(5) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 2 trailing nodes:

M(0, z0) → c(IF(false, 0, z0), GT(0, z0))
M(x0, x1) → c

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
S tuples:

IF(true, z0, z1) → c1(M(p(z0), z1), P(z0))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
K tuples:none
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

IF, GT, M

Compound Symbols:

c1, c5, c

(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace IF(true, z0, z1) → c1(M(p(z0), z1), P(z0)) by

IF(true, 0, x1) → c1(M(0, x1), P(0))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
IF(true, x0, x1) → c1

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, 0, x1) → c1(M(0, x1), P(0))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
IF(true, x0, x1) → c1
S tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, 0, x1) → c1(M(0, x1), P(0))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
IF(true, x0, x1) → c1
K tuples:none
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

GT, M, IF

Compound Symbols:

c5, c, c1, c1

(9) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 2 trailing nodes:

IF(true, x0, x1) → c1
IF(true, 0, x1) → c1(M(0, x1), P(0))

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
S tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
K tuples:none
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

GT, M, IF

Compound Symbols:

c5, c, c1

(11) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
We considered the (Usable) Rules:

gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
And the Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(GT(x1, x2)) = 0   
POL(IF(x1, x2, x3)) = [2]x2   
POL(M(x1, x2)) = [2]x1   
POL(P(x1)) = 0   
POL(c(x1, x2)) = x1 + x2   
POL(c1(x1, x2)) = x1 + x2   
POL(c5(x1)) = x1   
POL(false) = [2]   
POL(gt(x1, x2)) = [5]x1   
POL(s(x1)) = [4] + x1   
POL(true) = 0   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
S tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
K tuples:

IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

GT, M, IF

Compound Symbols:

c5, c, c1

(13) CdtKnowledgeProof (EQUIVALENT transformation)

The following tuples could be moved from S to K by knowledge propagation:

M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
S tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
K tuples:

IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

GT, M, IF

Compound Symbols:

c5, c, c1

(15) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

GT(s(z0), s(z1)) → c5(GT(z0, z1))
We considered the (Usable) Rules:

gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
And the Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(GT(x1, x2)) = [2]x1   
POL(IF(x1, x2, x3)) = [2]x22   
POL(M(x1, x2)) = [2] + [2]x1 + [2]x12   
POL(P(x1)) = 0   
POL(c(x1, x2)) = x1 + x2   
POL(c1(x1, x2)) = x1 + x2   
POL(c5(x1)) = x1   
POL(false) = 0   
POL(gt(x1, x2)) = 0   
POL(s(x1)) = [1] + x1   
POL(true) = 0   

(16) Obligation:

Complexity Dependency Tuples Problem
Rules:

m(z0, z1) → if(gt(z0, z1), z0, z1)
if(true, z0, z1) → s(m(p(z0), z1))
if(false, z0, z1) → 0
gt(0, z0) → false
gt(s(z0), 0) → true
gt(s(z0), s(z1)) → gt(z0, z1)
p(0) → 0
p(s(z0)) → z0
Tuples:

GT(s(z0), s(z1)) → c5(GT(z0, z1))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
S tuples:none
K tuples:

IF(true, s(z0), x1) → c1(M(z0, x1), P(s(z0)))
M(s(z0), 0) → c(IF(true, s(z0), 0), GT(s(z0), 0))
M(s(z0), s(z1)) → c(IF(gt(z0, z1), s(z0), s(z1)), GT(s(z0), s(z1)))
GT(s(z0), s(z1)) → c5(GT(z0, z1))
Defined Rule Symbols:

m, if, gt, p

Defined Pair Symbols:

GT, M, IF

Compound Symbols:

c5, c, c1

(17) SIsEmptyProof (EQUIVALENT transformation)

The set S is empty

(18) BOUNDS(O(1), O(1))